package com.iscc.maoke.service.impl;

import com.iscc.maoke.dao.TypeDAO;
import com.iscc.maoke.dao.impl.TypeDAOImpl;
import com.iscc.maoke.domain.Type;
import com.iscc.maoke.service.TypeService;

import java.util.List;

public class TypeServiceImpl implements TypeService {

    private TypeDAO typeDAO = new TypeDAOImpl();

    @Override
    public List<Type> queryAllTypeByCondition(String name) {
        return typeDAO.queryAllTypeByCondition(name);
    }

    @Override
    public int addType(Type type) {
        return typeDAO.add(type);
    }

    @Override
    public int updateType(Type type) {
        return typeDAO.update(type);
    }

    @Override
    public int delType(int tno) {
        return typeDAO.del(tno);
    }

    @Override
    public Type queryTypeById(int id) {
        return typeDAO.queryById(id);
    }
}
